<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script src="ajax.js"></script>
</head>
<body>
<script>
	var d = new Date();
	document.write(d);
</script>
<input type="text">
	<p id="p">

	</p>
	<button onclick="load()">加载</button>
	<script>
		function load()
		{
			$.ajax({
				
				url:'3.php?s=sdsdf',

				success:function(data)
				{
					document.getElementById('p').innerHTML=data;
				},
				error:function()
				{
					alert('请求失败，稍候重试.');
				}
			});
		}
	</script>

</body>
</html>